package com.yun.cloud.cfgbean;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * Created by lsy
 * on 2018/6/8 15:28.
 * boot ->spring  applicationContext.xml ------------> @Configuration 配置
 */
@Configuration
public class ConfigBean {

    // 注入restTemplate
    @Bean
    @LoadBalanced
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
}
